#include <iostream>
#include <set>
using namespace std;

bool check(int nums[], int sum, int len){
    set<int> S;
    for(int i = 0; i < len; i++){
        if(S.find(sum - nums[i]) != S.end()){
            return true;
        }
        S.insert(nums[i]);
    }
    return false;
}

int main(){
    int nums[] = {8, 6, 10, 5, 7, 9, 11};
    cout<<check(nums, 12, 7);
    return 0;
}